package com.牛客网.jd;

import java.util.Scanner;

public class 进制问题 {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNext()) {
			int number = scanner.nextInt();
			int sum = 0;
			for (int i = 2; i < number; i++) {
				sum += getJinzhiNumber(number, i);
			}
			MaxDivisorMinMultiple mdmm = new MaxDivisorMinMultiple(sum, (number - 2));
			System.out.println(sum / mdmm.getMaxDivsior() + "/" + (number - 2) / mdmm.getMaxDivsior());
		}
	}

	//得到数字的jinzhi表示的各个位数数字的和
	public static int getJinzhiNumber(int number, int jinzhi) {
		int n1 = 1;
		int sum = number % jinzhi;
		while ((n1 = (number / jinzhi)) != 0) {
			number = n1;
			sum += (number % jinzhi);
		}
		return sum;
	}

}

class MaxDivisorMinMultiple {
	private int m, n;
	private int MaxDivsior;

	// 构造函数
	public MaxDivisorMinMultiple(int m, int n) {
		if (m > n)// 输入的两个数中, 大数赋值给m, 小数赋值给n,
		{
			this.m = m;
			this.n = n;
		} else {
			this.m = n;
			this.n = m;
		}

	}

	public int getMaxDivsior() {
		for (int i = n; i >= 1; i--) {
			// 小n的数中第一个能被m和n整除的
			if (n % i == 0 && m % i == 0) {
				MaxDivsior = i;
				break;
			}
		}
		return MaxDivsior;
	}
}
